Skip to content

fix: stop telling Linux and Windows they are a Mac - #48

Merged
itz4blitz merged 2 commits into
mainfrom
fix/linux-platform-copy
Oct 20, 2026
Merged

itz4blitz merged 2 commits into
mainfrom
fix/linux-platform-copy

Conversation

@itz4blitz

@itz4blitz itz4blitz commented Oct 18, 2026 •

Copy link
Copy Markdown
Owner

Summary

The Linux build of 0.2.5 shows Mac copy: "Your sign-in is kept in the macOS keychain on this Mac.", "Show in Finder", and "Choose Always Allow". Those sentences were compiled in for every system.

host now names the computer this build runs on.

  • macOS stays on the keychain, Finder, and Always Allow.
  • Linux says the system keyring, "this computer", and "Show in folder". Copied diagnostics use PRETTY_NAME from os-release instead of a sw_vers line that never appears.
  • Windows says Credential Manager, "this PC", and File Explorer.
  • Opening a call link on Linux uses xdg-open, the same as opening a file already does.

Review fixes (second commit)

  • Windows call links open whole. cmd /C start "" <url> split a link at its first & (Teams msteams:/l/channel/…?groupId=…&tenantId=…, Telegram tg://privatepost?channel=…&post=…), so the app got a cut-short link and cmd ran tenantId=… as a command. The link now goes to ShellExecuteW (windows-sys gains Win32_UI_Shell and Win32_UI_WindowsAndMessaging; nothing new in Cargo.lock). Its return still separates "Nothing on this PC opens …" (no association, or the handler's program is gone) from "This PC could not open the link." gpui's own open_url calls ShellExecuteW too but returns nothing, so it could not report either.
  • Copy diagnostics opens no console on Windows. sw_vers, ver and ps run through protocol::launch::no_console. os_version is now one function per OS rather than returns in cfg blocks.
  • Linux os-release follows os-release(5). It falls back to /usr/lib/os-release, unquotes single and double quotes, unescapes \", \\, \$ and \`, and says "Linux" when PRETTY_NAME is missing or empty. The parser is a pure function with fixture tests. The Linux test that read the real file can no longer panic in a container without one.
  • Windows does not mention a prompt. Credential Manager never asks, so the waiting line says tinyclient is still reading its saved sign-ins.
  • The remaining Mac-only lines follow the system:
    • Appearance: "Reduce Motion follows System Settings." on macOS only, since it is read from macOS defaults.
    • Shortcuts: the App Shortcuts instructions on macOS only. Elsewhere it says "Shortcuts cannot be changed yet."
    • Settings search: the badge answer names the Dock, the taskbar, or an unread badge. The menu bar icon answer names the menu bar, the system tray, or the tray.
    • "Hide tinyclient" and "Hide Others" are listed and bound on macOS only. GPUI ignores hiding on Linux and hits unimplemented!() for Hide Others on Windows, so Ctrl+Alt+H used to crash the Windows build.
    • chatd: session::STORE names the keychain, Credential Manager, or the system keyring. The words for no store, waiting, refused, Telegram's "couldn't save the sign-in", the Signal vault key and the sign-out read error all use it. The Windows waiting line is "Still reading your sign-in from Credential Manager."
    • Telegram's Active Sessions shows "Mac", "Windows PC" or "Linux PC" instead of "Mac" for everyone. grammers still fills in the OS version.
  • The unused host::OS_NAME is removed.

Test plan

Run on macOS (arm64) against this branch, rebased on main at b9f227b:

  • cargo test -p tinyclient host: 2 passed
  • cargo test -p tinyclient: 14 passed
  • cargo test -p tinyclient --features gui: 351 passed, 1 ignored. Covers the new shortcut-list test and the host fixtures.
  • cargo test -p chatd --lib: 137 passed. Covers the new each_system_names_its_own_store.
  • cargo test -p chatd --test polish: 12 passed. The waiting detail is checked against session::STORE_WAITING, which is pinned per OS in the unit test.
  • cargo test -p chatd: every target passed (292 tests)
  • cargo clippy -p tinyclient --features gui --all-targets: no warnings in touched lines. The ones left in touched files, menubar.rs let _ = cx.update(…) and app/mod.rs let _ = cx.update(…), are on main too.
  • cargo clippy -p chatd --all-targets -- -A clippy::while_immutable_condition: no warnings in touched lines. The deny-level lint at discord/gateway.rs:488 is on main and stops plain clippy.
  • cargo check -p tinyclient --tests --target x86_64-pc-windows-msvc and --target x86_64-unknown-linux-gnu: clean
  • The Windows system_open body type-checks and is clippy-clean in a scratch crate against windows-sys 0.61.2 for x86_64-pc-windows-msvc. The full gui build for Windows needs llvm-rc, which this Mac doesn't have, so CI's Windows package job compiles it.
  • CI run 39432153212: test and package passed on ubuntu-22.04, macos-latest and windows-latest. The Windows package job builds the gui with the ShellExecuteW path.
  • Windows by hand: "Open in Teams" on a channel call opens the channel, and no second command runs
  • Linux welcome screen says the system keyring, not the macOS keychain
  • macOS welcome screen still says the macOS keychain

🤖 Generated with Claude Code

@itz4blitz itz4blitz self-assigned this Oct 18, 2026
itz4blitz and others added 2 commits October 20, 2026 09:20
The window hardcoded the macOS keychain, Finder, and Always Allow. Those sentences now follow the computer the build runs on: the system keyring on Linux, Credential Manager on Windows.
…s in chatd too

Windows handed a call link to `cmd /C start`, which split it at the first `&`: a Teams or Telegram link opened cut short and cmd ran the rest as a command. It goes to ShellExecuteW now, whose answer still tells "nothing opens this" from "could not open". Copy diagnostics asks for the Windows version without flashing a console. Linux reads os-release as a shell would, from /usr/lib when /etc has none, and says Linux when it names nothing. Windows no longer tells of a Credential Manager prompt that never comes.

The lines still written for a Mac follow the system too. The Reduce Motion and App Shortcuts captions are macOS only; the badge and menu bar icon answers name the taskbar and the tray; Hide tinyclient and Hide Others are listed and bound on macOS only, since Hide Others panicked on Windows. chatd names the keychain, Credential Manager or the system keyring, and Telegram's device list no longer calls every computer a Mac.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@itz4blitz
itz4blitz force-pushed the fix/linux-platform-copy branch from 3103272 to 9d8f73b Compare October 20, 2026 13:38
@itz4blitz
itz4blitz merged commit 17efe91 into main Oct 20, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant